<template>
  <div 
    class="nav-item" 
    @click="changeTabIndex(index)">
      {{ item | replaceNumToChs }}
  </div>
</template>

<script>
import { mapMutations } from "vuex";
import { replaceNumToChs } from "@/filters";
export default {
  name: "NavItem",
  props: {
    item: String,
    index: Number,
  },
  filters: {
    replaceNumToChs,
  },
  methods: {
    ...mapMutations(["changeTabIndex"]),
  },
};
</script>

<style>
.nav-item {
  width: 25%;
  float: left;
  text-align: center;
  line-height: 50px;
}

.nav-current {
  color: #fff;
  background-color: #000;
}
</style>
